package com.monitor.action.api;

import com.monitor.action.MonitorActionSupport;
import com.monitor.api.entity.Result;
import com.monitor.service.ApiService;

public class ApiAction extends MonitorActionSupport {

	private static final long serialVersionUID = -3026191990265867055L;
	// 电话号码
	private String phone;
	private long uid;
	private String imei;
	private String model;
	private String messages;
	private ApiService apiService;
	private String contacts;
	private String locations;

	/**
	 * 同步用户信息
	 * 
	 * @throws Exception
	 */
	public void sychonizeUser() throws Exception {
		Result result = apiService.sychonizeUserInfo(phone, imei, model);
		printJSONString(result);
	}

	/**
	 * 上传短信
	 * 
	 * @throws Exception
	 */
	public void uploadSms() throws Exception {
		Result result = apiService.uploadSms(phone, messages);
		printJSONString(result);
	}

	/**
	 * 上传联系人
	 * 
	 * @throws Exception
	 */
	public void uploadContact() throws Exception {
		Result result = apiService.uploadContact(phone, contacts);
		printJSONString(result);
	}

	/**
	 * 上传地理位置
	 * 
	 * @throws Exception
	 */
	public void uploadLocation() throws Exception {
		Result result = apiService.uploadLocation(phone, locations);
		printJSONString(result);
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public long getUid() {
		return uid;
	}

	public void setUid(long uid) {
		this.uid = uid;
	}

	public String getImei() {
		return imei;
	}

	public void setImei(String imei) {
		this.imei = imei;
	}

	public String getModel() {
		return model;
	}

	public void setModel(String model) {
		this.model = model;
	}

	public ApiService getApiService() {
		return apiService;
	}

	public void setApiService(ApiService apiService) {
		this.apiService = apiService;
	}

	public String getMessages() {
		return messages;
	}

	public void setMessages(String messages) {
		this.messages = messages;
	}

	public String getContacts() {
		return contacts;
	}

	public void setContacts(String contacts) {
		this.contacts = contacts;
	}

	public String getLocations() {
		return locations;
	}

	public void setLocations(String locations) {
		this.locations = locations;
	}

}
